#include<string>
#include<iostream>
#include<map>

using namespace std;
const int N = 5e5 + 10, mod = 998244353;
string s[1004], s1[1004];
void solve()
{
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> s[i] >> s1[i];
    for (int i = 1; i <= n; i++)
    {
        map<string, int>ma;
        int cnt = 0;
        for (int j = i; j <= n; j++)
        {
            if (s[j] == s[i])
            {
                if (ma[s1[j]] == 0)
                {
                    cnt++;
                    ma[s1[j]] = 1;
                }
                else
                    break;

                if (cnt == 5)
                {
                    cout << "PENTA KILL!\n";
                    return;
                }
            }
        }
    }
    cout << "SAD:(\n";
    return;
}
signed main()
{
    solve();
    return 0;
}